package com.renu.jdependencyanalyser.model;


import java.util.HashSet;
import java.util.Set;

//@Data
public class MethodModel {
    // classSig::\nreturnType methodName(args)
    private String methodSig;

    private String classSig;

    private String access;

    @Deprecated
    private Set<String> localTypes;

    private Set<String> srcMethods;

    private Set<String> tgtMethods;

    //private Set<String> outerParameters;
    //
    //private Set<String> outerLocals;


    public MethodModel(String methodSig) {
        this.methodSig = methodSig;
        this.classSig = "";
        //localTypes = new HashSet<>();
        srcMethods = new HashSet<>();
        tgtMethods = new HashSet<>();
    }



    public String getAccess() {
        return access;
    }

    public void setAccess(String access) {
        this.access = access;
    }

    public String getMethodSig() {
        return methodSig;
    }

    public void setMethodSig(String methodSig) {
        this.methodSig = methodSig;
    }

    public String getClassSig() {
        return classSig;
    }

    public void setClassSig(String classSig) {
        this.classSig = classSig;
    }

    public Set<String> getLocalTypes() {
        return localTypes;
    }

    public void setLocalTypes(Set<String> localTypes) {
        this.localTypes = localTypes;
    }

    public Set<String> getSrcMethods() {
        return srcMethods;
    }

    public void setSrcMethods(Set<String> srcMethods) {
        this.srcMethods = srcMethods;
    }

    public Set<String> getTgtMethods() {
        return tgtMethods;
    }

    public void setTgtMethods(Set<String> tgtMethods) {
        this.tgtMethods = tgtMethods;
    }

    public void addLocal(String localType) {
        localTypes.add(localType);
    }


    public void addOuterMethod(String outerMethod) {
        tgtMethods.add(outerMethod);
    }

    //public void bindInOut(MethodModel srcMethodModel, MethodModel tgtMethodModel) {
    //    if (srcMethodModel!= null){
    //        srcMethodModel.addOuterMethod(tgtMethodModel.getMethodSig());
    //    }
    //    if (tgtMethodModel!= null){
    //        tgtMethodModel.addInnerMethod(srcMethodModel.getMethodSig());
    //    }
    //}

    public void addInnerMethod(String inMethod) {
        srcMethods.add(inMethod);
    }
}
